package com.homework.ch01;

import java.util.function.IntBinaryOperator;

/**
 * @author yuxi
 * @version 1.0
 * @date 2025/10/22
 * @Description:
 */


public class Test1 {
    public static void main(String[] args) {
        int result=calculateNum(new IntBinaryOperator() {
            @Override
            public int applyAsInt(int a, int b) {
                return a+b;
            }
        });
        System.out.println(result);
        int result2=calculateNum((a,b)->a+b);
        System.out.println(result2);
    }
    public static int calculateNum(IntBinaryOperator operator){
        int a = 5;
        int b = 20;
        return operator.applyAsInt(a, b);
    }
}
